package cn.remex.wechat.models;

import cn.remex.db.rsql.model.ModelableImpl;
import cn.remex.wechat.config.WeChatAppType;

import javax.persistence.Column;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import static cn.remex.wechat.config.WeChatAppType.mp;

/**
 * 名称：
 * 缩写：
 * 用途：
 * Created by yangy on 2017/1/20 0020.
 */
@Table(
		indexes = {@Index(columnList = "appName")},
		uniqueConstraints = {@UniqueConstraint(columnNames = {"appName"})})
public class WeChatAppConfig extends ModelableImpl {
	private WeChatAppType type = mp;
	private boolean defaultApp;
	@Column(nullable = false)
	private String appName;
	@Column(nullable = false)
	private String appid;
	@Column(nullable = false)
	private String token;
	@Column(nullable = false)
	private String secret;
	private String encodingAESKey;

	@Column(nullable = false)
	private String agentid = "0";//企业号的应用id;服务号默认为0
	@Column(length = 512)
	private String subscribeMsg;
	private String payBackUrl;
	private String redirectDomain;
	@Column(length = 1024)
	private String stateRedirects;
	@Column(length = 1024)
	private String wxClickEventMsgs;
	@Column(length = 4096)
	private String menus;
	private String mchid;//支付商户号
	private String key;//支付用途


	public WeChatAppType getType() {
		return type;
	}

	public void setType(WeChatAppType type) {
		this.type = type;
	}

	public boolean isDefaultApp() {
		return defaultApp;
	}

	public void setDefaultApp(boolean defaultApp) {
		this.defaultApp = defaultApp;
	}

	public String getAppName() {
		return appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	public String getAppid() {
		return appid;
	}

	public void setAppid(String appid) {
		this.appid = appid;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getSecret() {
		return secret;
	}

	public void setSecret(String secret) {
		this.secret = secret;
	}

	public String getEncodingAESKey() {
		return encodingAESKey;
	}

	public void setEncodingAESKey(String encodingAESKey) {
		this.encodingAESKey = encodingAESKey;
	}

	public String getAgentid() {
		return agentid;
	}

	public void setAgentid(String agentid) {
		this.agentid = agentid;
	}

	public String getSubscribeMsg() {
		return subscribeMsg;
	}

	public void setSubscribeMsg(String subscribeMsg) {
		this.subscribeMsg = subscribeMsg;
	}

	public String getPayBackUrl() {
		return payBackUrl;
	}

	public void setPayBackUrl(String payBackUrl) {
		this.payBackUrl = payBackUrl;
	}

	public String getRedirectDomain() {
		return redirectDomain;
	}

	public void setRedirectDomain(String redirectDomain) {
		this.redirectDomain = redirectDomain;
	}

	public String getStateRedirects() {
		return stateRedirects;
	}

	public void setStateRedirects(String stateRedirects) {
		this.stateRedirects = stateRedirects;
	}

	public String getWxClickEventMsgs() {
		return wxClickEventMsgs;
	}

	public void setWxClickEventMsgs(String wxClickEventMsgs) {
		this.wxClickEventMsgs = wxClickEventMsgs;
	}

	public String getMenus() {
		return menus;
	}

	public void setMenus(String menus) {
		this.menus = menus;
	}

	public String getMchid() {
		return mchid;
	}

	public void setMchid(String mchid) {
		this.mchid = mchid;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}
}
